package com.ruoyi.mp.api.domain;

import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 公众号账号对象 mp_account
 *
 * @author ruoyi
 * @date 2023-11-19
 */
public class MpAccount extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 编号 */
    private Long id;

    /** 公众号名称 */
    @Excel(name = "公众号名称")
    private String name;

    /** 公众号账号 */
    @Excel(name = "公众号账号")
    private String account;

    /** 公众号appid */
    @Excel(name = "公众号appid")
    private String appId;

    /** 公众号密钥 */
    @Excel(name = "公众号密钥")
    private String appSecret;

    /** 公众号url */
    @Excel(name = "公众号url")
    private String url;

    /** 公众号token */
    @Excel(name = "公众号token")
    private String token;

    /** 加密密钥 */
    @Excel(name = "加密密钥")
    private String aesKey;

    /** 二维码图片URL */
    @Excel(name = "二维码图片URL")
    private String qrCodeUrl;



    /** 是否删除 */
    @Excel(name = "是否删除")
    private String deleted;

    /** 租户编号 */
    @Excel(name = "租户编号")
    private Long tenantId;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setName(String name)
    {
        this.name = name;
    }

    public String getName()
    {
        return name;
    }
    public void setAccount(String account)
    {
        this.account = account;
    }

    public String getAccount()
    {
        return account;
    }
    public void setAppId(String appId)
    {
        this.appId = appId;
    }

    public String getAppId()
    {
        return appId;
    }
    public void setAppSecret(String appSecret)
    {
        this.appSecret = appSecret;
    }

    public String getAppSecret()
    {
        return appSecret;
    }
    public void setUrl(String url)
    {
        this.url = url;
    }

    public String getUrl()
    {
        return url;
    }
    public void setToken(String token)
    {
        this.token = token;
    }

    public String getToken()
    {
        return token;
    }
    public void setAesKey(String aesKey)
    {
        this.aesKey = aesKey;
    }

    public String getAesKey()
    {
        return aesKey;
    }
    public void setQrCodeUrl(String qrCodeUrl)
    {
        this.qrCodeUrl = qrCodeUrl;
    }

    public String getQrCodeUrl()
    {
        return qrCodeUrl;
    }


    public String getDeleted()
    {
        return deleted;
    }
    public void setTenantId(Long tenantId)
    {
        this.tenantId = tenantId;
    }

    public Long getTenantId()
    {
        return tenantId;
    }
    public WxMpDefaultConfigImpl toWxMpConfigStorage(){
        WxMpDefaultConfigImpl configStorage = new WxMpDefaultConfigImpl();
        configStorage.setAppId(appId);
        configStorage.setSecret(appSecret);
        configStorage.setToken(token);
        configStorage.setAesKey(aesKey);
        return configStorage;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("name", getName())
                .append("account", getAccount())
                .append("appId", getAppId())
                .append("appSecret", getAppSecret())
                .append("url", getUrl())
                .append("token", getToken())
                .append("aesKey", getAesKey())
                .append("qrCodeUrl", getQrCodeUrl())
                .append("remark", getRemark())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("deleted", getDeleted())
                .append("tenantId", getTenantId())
                .toString();
    }
}
